using System;
using System.Collections.Generic;
using System.Text;
using WindowsLive.Writer.Api;
using System.Windows.Forms;

namespace insertLink
{
    [WriterPlugin("a564e66e-b9a7-4815-8f8b-df62ba8a4e32", "Insert Link",
        Description="Brings up the Insert link dialog when you paste a link.",
        HasEditableOptions=false,
        Name="Insert Link",
        PublisherUrl="http://scottisafool.spaces.live.com/")]
    [UrlContentSource("(https?|ftp)://",
        RequiresProgress=false,
        UrlPattern="(https?|ftp)://")]
    
    public class insLink : ContentSource
    {
        public insLink()
        {
        }

        public override void  CreateContentFromUrl(string url, ref string title, ref string newContent)
        {
            using (frmLink form = new frmLink(url))
            {
                DialogResult result = form.ShowDialog();
                if (result == DialogResult.OK)
                {
                    newContent = form.getText;
                }

            }

        }



    }
}
